org.springframework.data.document.mongodb.mapping
Class BasicMongoPersistentProperty

java.lang.Object
  extended by 
      extended by org.springframework.data.document.mongodb.mapping.BasicMongoPersistentProperty
All Implemented Interfaces:
MongoPersistentProperty

public class BasicMongoPersistentProperty
extends
implements MongoPersistentProperty

Mongo specific org.springframework.data.mapping.model.PersistentProperty implementation.

Author:
Oliver Gierke

Field Summary
private static Log LOG
           
private static java.util.Set<java.lang.String> SUPPORTED_ID_PROPERTY_NAMES
           
private static java.util.Set<java.lang.Class<?>> SUPPORTED_ID_TYPES
           
 
Constructor Summary
BasicMongoPersistentProperty(java.lang.reflect.Field field, java.beans.PropertyDescriptor propertyDescriptor, MongoPersistentEntity<?> owner)
          Creates a new BasicMongoPersistentProperty.
 
Method Summary
protected   createAssociation()
           
 DBRef getDBRef()
          Returns the DBRef if the property is a reference.
 java.lang.String getFieldName()
          Returns the key to be used to store the value of the property inside a Mongo DBObject.
 boolean isAssociation()
           
 boolean isDbReference()
          Returns whether the propert is a com.mongodb.DBRef.
 boolean isIdProperty()
          Also considers fields as id that are of supported id type and name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

SUPPORTED_ID_TYPES

private static final java.util.Set<java.lang.Class<?>> SUPPORTED_ID_TYPES

SUPPORTED_ID_PROPERTY_NAMES

private static final java.util.Set<java.lang.String> SUPPORTED_ID_PROPERTY_NAMES
Constructor Detail

BasicMongoPersistentProperty

public BasicMongoPersistentProperty(java.lang.reflect.Field field,
                                    java.beans.PropertyDescriptor propertyDescriptor,
                                    MongoPersistentEntity<?> owner)
Creates a new BasicMongoPersistentProperty.

Parameters:
field -
propertyDescriptor -
owningTypeInformation -
Method Detail

isAssociation

public boolean isAssociation()

isIdProperty

public boolean isIdProperty()
Also considers fields as id that are of supported id type and name.

See Also:
SUPPORTED_ID_PROPERTY_NAMES, SUPPORTED_ID_TYPES

getFieldName

public java.lang.String getFieldName()
Returns the key to be used to store the value of the property inside a Mongo DBObject.

Specified by:
getFieldName in interface MongoPersistentProperty
Returns:

createAssociation

protected  createAssociation()

isDbReference

public boolean isDbReference()
Description copied from interface: MongoPersistentProperty
Returns whether the propert is a com.mongodb.DBRef. If this returns true you can expect MongoPersistentProperty.getDBRef() to return an non-null value.

Specified by:
isDbReference in interface MongoPersistentProperty
Returns:

getDBRef

public DBRef getDBRef()
Description copied from interface: MongoPersistentProperty
Returns the DBRef if the property is a reference.

Specified by:
getDBRef in interface MongoPersistentProperty
Returns:
See Also:
MongoPersistentProperty.isDbReference()